home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / SoundInput.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  5.9 KB  |  150 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SoundInput.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __SOUNDINPUT__
  13. #define __SOUNDINPUT__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19. #ifndef __DIALOGS__
  20. #include <Dialogs.h>
  21. #endif
  22.  
  23. #ifndef __FILES__
  24. #include <Files.h>
  25. #endif
  26.  
  27.  
  28. enum {
  29.  
  30.  siDeviceIsConnected = 1,                /* input device is connected and ready for input */
  31.  siDeviceNotConnected = 0,                /* input device is not connected */
  32.  siDontKnowIfConnected = -1,            /* can't tell if input device is connected */
  33.  siReadPermission = 0,                    /* permission passed to SPBOpenDevice */
  34.  siWritePermission = 1                    /* permission passed to SPBOpenDevice */
  35.  
  36. /* Info Selectors for Sound Input Drivers */
  37.  
  38. #define siDeviceConnected 'dcon'        /* input device connection status */
  39. #define siAGCOnOff 'agc '                /* automatic gain control state */
  40. #define siPlayThruOnOff 'plth'            /* playthrough state */
  41. #define siTwosComplementOnOff 'twos'    /* two's complement state */
  42. #define siLevelMeterOnOff 'lmet'        /* level meter state */
  43. #define siRecordingQuality 'qual'        /* recording quality */
  44. #define siVoxRecordInfo 'voxr'            /* VOX record parameters */
  45. #define siVoxStopInfo 'voxs'            /* VOX stop parameters */
  46. #define siNumberChannels 'chan'            /* current number of channels */
  47. #define siSampleSize 'ssiz'                /* current sample size */
  48. #define siSampleRate 'srat'                /* current sample rate */
  49. #define siCompressionType 'comp'        /* current compression type */
  50. #define siCompressionFactor 'cmfa'        /* current compression factor */
  51. #define siCompressionHeader 'cmhd'        /* return compression header */
  52. #define siDeviceName 'name'                /* input device name */
  53. #define siDeviceIcon 'icon'                /* input device icon */
  54. #define siDeviceBufferInfo 'dbin'        /* size of interrupt buffer */
  55. #define siSampleSizeAvailable 'ssav'    /* sample sizes available */
  56. #define siSampleRateAvailable 'srav'    /* sample rates available */
  57. #define siCompressionAvailable 'cmav'    /* compression types available */
  58. #define siChannelAvailable 'chav'        /* number of channels available */
  59. #define siAsync 'asyn'                    /* asynchronous capability */
  60. #define siOptionsDialog 'optd'            /* display options dialog */
  61. #define siContinuous 'cont'                /* continous recording */
  62. #define siActiveChannels 'chac'            /* active channels */
  63. #define siActiveLevels 'lmac'            /* active meter levels */
  64. #define siInputSource 'sour'            /* input source selector */
  65. #define siInitializeDriver 'init'        /* reserved for internal use only */
  66. #define siCloseDriver 'clos'            /* reserved for internal use only */
  67. #define siPauseRecording 'paus'            /* reserved for internal use only */
  68. #define siUserInterruptProc 'user'        /* reserved for internal use only */
  69.  
  70. /* Qualities */
  71. #define siBestQuality 'best'
  72. #define siBetterQuality 'betr'
  73. #define siGoodQuality 'good'
  74. };
  75.  
  76. /* Sound Input Parameter Block */
  77. struct SPB {
  78.  long inRefNum;                            /* reference number of sound input device */
  79.  unsigned long count;                    /* number of bytes to record */
  80.  unsigned long milliseconds;            /* number of milliseconds to record */
  81.  unsigned long bufferLength;            /* length of buffer in bytes */
  82.  Ptr bufferPtr;                            /* buffer to store sound data in */
  83.  ProcPtr completionRoutine;                /* completion routine */
  84.  ProcPtr interruptRoutine;                /* interrupt routine */
  85.  long userLong;                            /* user-defined field */
  86.  OSErr error;                            /* error */
  87.  long unused1;                            /* reserved - must be zero */
  88. };
  89.  
  90. typedef struct SPB SPB;
  91. typedef SPB *SPBPtr;
  92.  
  93.  
  94. #ifdef __cplusplus
  95. extern "C" {
  96. #endif
  97. pascal NumVersion SPBVersion(void)
  98.  = {0x203C,0x0000,0x0014,0xA800}; 
  99. pascal OSErr SndRecord(ModalFilterProcPtr filterProc,Point corner,OSType quality,
  100.  Handle *sndHandle)
  101.  = {0x203C,0x0804,0x0014,0xA800}; 
  102. pascal OSErr SndRecordToFile(ModalFilterProcPtr filterProc,Point corner,
  103.  OSType quality,short fRefNum)
  104.  = {0x203C,0x0708,0x0014,0xA800}; 
  105. pascal OSErr SPBSignInDevice(short deviceRefNum,ConstStr255Param deviceName)
  106.  = {0x203C,0x030C,0x0014,0xA800}; 
  107. pascal OSErr SPBSignOutDevice(short deviceRefNum)
  108.  = {0x203C,0x0110,0x0014,0xA800}; 
  109. pascal OSErr SPBGetIndexedDevice(short count,Str255 deviceName,Handle *deviceIconHandle)
  110.  = {0x203C,0x0514,0x0014,0xA800}; 
  111. pascal OSErr SPBOpenDevice(ConstStr255Param deviceName,short permission,
  112.  long *inRefNum)
  113.  = {0x203C,0x0518,0x0014,0xA800}; 
  114. pascal OSErr SPBCloseDevice(long inRefNum)
  115.  = {0x203C,0x021C,0x0014,0xA800}; 
  116. pascal OSErr SPBRecord(SPBPtr inParamPtr,Boolean asynchFlag)
  117.  = {0x203C,0x0320,0x0014,0xA800}; 
  118. pascal OSErr SPBRecordToFile(short fRefNum,SPBPtr inParamPtr,Boolean asynchFlag)
  119.  = {0x203C,0x0424,0x0014,0xA800}; 
  120. pascal OSErr SPBPauseRecording(long inRefNum)
  121.  = {0x203C,0x0228,0x0014,0xA800}; 
  122. pascal OSErr SPBResumeRecording(long inRefNum)
  123.  = {0x203C,0x022C,0x0014,0xA800}; 
  124. pascal OSErr SPBStopRecording(long inRefNum)
  125.  = {0x203C,0x0230,0x0014,0xA800}; 
  126. pascal OSErr SPBGetRecordingStatus(long inRefNum,short *recordingStatus,
  127.  short *meterLevel,unsigned long *totalSamplesToRecord,unsigned long *numberOfSamplesRecorded,
  128.  unsigned long *totalMsecsToRecord,unsigned long *numberOfMsecsRecorded)
  129.  = {0x203C,0x0E34,0x0014,0xA800}; 
  130. pascal OSErr SPBGetDeviceInfo(long inRefNum,OSType infoType,char *infoData)
  131.  = {0x203C,0x0638,0x0014,0xA800}; 
  132. pascal OSErr SPBSetDeviceInfo(long inRefNum,OSType infoType,char *infoData)
  133.  = {0x203C,0x063C,0x0014,0xA800}; 
  134. pascal OSErr SPBMillisecondsToBytes(long inRefNum,long *milliseconds)
  135.  = {0x203C,0x0440,0x0014,0xA800}; 
  136. pascal OSErr SPBBytesToMilliseconds(long inRefNum,long *byteCount)
  137.  = {0x203C,0x0444,0x0014,0xA800}; 
  138. pascal OSErr SetupSndHeader(Handle sndHandle,short numChannels,Fixed sampleRate,
  139.  short sampleSize,OSType compressionType,short baseNote,unsigned long numBytes,
  140.  short *headerLen)
  141.  = {0x203C,0x0D48,0x0014,0xA800}; 
  142. pascal OSErr SetupAIFFHeader(short fRefNum,short numChannels,Fixed sampleRate,
  143.  short sampleSize,OSType compressionType,unsigned long numBytes,unsigned long numFrames)
  144.  = {0x203C,0x0B4C,0x0014,0xA800}; 
  145. #ifdef __cplusplus
  146. }
  147. #endif
  148.  
  149. #endif
  150.